﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class MailRead3 : System.Web.UI.Page
{
    public string Meetname;
    public string title;
    public string sendname;
    public string pubdate;
    public string type;
    public string Appurtenance;
    public string Contents;
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        int id = Convert.ToInt32(Request["sid"].ToString());
        string sql = "select * from Draft,Employee where Draft.DraftId=" + id + " and Employee.username='" + Session["UserName"].ToString() + "'";
        SqlCommand com = new SqlCommand(sql, con);
        SqlDataReader dr = com.ExecuteReader();
        if (dr.Read())
        {
            Meetname = dr["Meetname"].ToString();
            title = dr["title"].ToString();
            sendname = dr["name"].ToString();
            pubdate = dr["addDate"].ToString();
            type = dr["type"].ToString();
            Appurtenance = dr["Appurtenance"].ToString();
            Contents = dr["Content"].ToString();
            string[] a;
            a = Appurtenance.Split(';');
            string[] AccIDList ={ "0" };
            for (int i = 0; i < a.Length; i++)
            {

                //LblAcc.Text += "<a href=\"upfiles/" + "+a[i]+"+  target=\"_blank\">" + a[i] + "</a>" + "&nbsp" + "&nbsp";
                LblAcc.Text += "<a href=\"upfiles/"
                        + a[i]
                        + "\" target=\"_blank\">"
                        + a[i]
                        + "</a>" + "&nbsp" + "&nbsp";
            }
            //LblAcc.Text+ = "<a href=\"upfiles/" 
            //    +  + "\" target=\"_blank\">" + "</a>" + "<br>";


        }

        con.Close();
    }
    protected void ddd_Click(object sender, EventArgs e)
    {

        Response.Redirect("UserWork/MailListC.aspx");
    }
}
